#pragma once
#include "Texture.h"
#include "Input.h"
#include "OSD.h"
#include "Player.h"
#include "UserInterface.h"
#include "EngineData.h"

class GameEngine
{
private:
	bool running;

	/** engine */
	DX9Engine* pEngine;

	/** input */
	Input* pInput;
	bool mbdown[MAX_MOUSEBUT];
	bool kbdown[MAX_KEYS];

	/** game states */
	enum GameState {MENU, GAME, WIN, LOSE} state;
	bool paused;
	bool gamestart;

	//// ADD GAME CODE HERE ////

	Texture bg;

	// onscreendislay
	OSD osd;

	Player p;

	UserInterface ui;
	bool igmenOn;		// for when in game menu is open or closed

public:
	GameEngine(void) 
		: gamestart(false)
	{}
	~GameEngine(void) { release(); }

	void release(void);
	void initialize();
	void update(float dT);
	void render(void);
	void renderText();
	bool isRunning() {return running;}
	void updateState()
	{
		// update game state based on UI state
		switch(ui.getState())
		{
		case 0: state = MENU; break;
		case 1: state = GAME; break;
		case 2: break;
		}
	}
};